package com.endoc.designpattern.docorator;

import com.endoc.designpattern.entity.Bag;

/**
 * 防伪装饰类,对原先类进行了防伪的功能增强
 */
public class CheckBagDecorator extends BagDecorator {
    public CheckBagDecorator(Bag bag) {
        super(bag);
    }

    @Override
    public void pack() {
        super.pack();
        //防伪功能增强
        checkBag();
    }

    private void checkBag() {
        System.out.println("执行了防伪标志");
    }

}
